The present invention generally relates to measuring performance of a processor in a virtual machine system which executes a second stage VM (Virtual Machine) on a first stage VM.
Generally, the complexity in operation is increased as the number of servers increases, and as a result, an operation cost becomes a problem. As a technology of reducing the operation cost, the server integration of collecting a plurality of servers into one server has received attention. As a technology of realizing the server integration, it is known a virtual machine technology (a virtual computer technology) of logically dividing one computer at an arbitrary ratio. In the virtual machine technology, for example, firmware such as a hypervisor (or middleware) divides a physical computer (physical machine) into a plurality of logical partitions (LPARs: Logical PARtitions), allocates a computer resource (a processor, a memory, and an I/O (Input/Output) device, typically) to each LPAR, and operates each OS (Operating System) on each LPAR. Otherwise, one host OS (an OS which directly uses the physical computer) is executed on one server, and a hypervisor operated on the host OS performs a dividing process in much the same way as the above so as to operate a plurality of guest OSs (OSs operated on the host OS). The virtual machine technology enables the OS operated in the plurality of servers and software operated on the OS to be operated in one server, whereby, the server integration is realized.
Moreover, generally, the virtual machine technology is a technology used in a large computer such as the general-purpose machine (Mainframe), and as a recent performance of a microprocessor is improved, the technology is gradually prevailed in a low-end server. A computer such as a server in which the virtual machine technology is adopted has a plurality of virtual machines which operate a guest (a general term for the guest OS and the software operated on the guest OS) and a virtual machine monitor (mentioned as “VMM”, hereinafter) which controls the virtual machine.
A processor is known which provides and expands a function of supporting the VMM. One example of the processor is an x86 processor. Especially among the low-end servers, the x86 processor provides and expands the function of supporting the VMM, the x86 server mounted with the x86 processor improves performance of the virtual machine. It is presumed that performance of the x86 server will be continuously improved in the future, and therefore, the number of the guests capable of being operated on one server tends to be increased.
If this tendency continues, then there will be a concern that a number of guests may be stopped at the same time when a failure occurs. This concern may be efficiently addressed by an occupying system. In the occupying system, the computer resource (the processor, the memory, and the I/O (Input/Output) device, typically) is occupied by a single guest so as to minimize a range of influence at a time of the failure, and thereby, a reliability is improved. On the other hand, there is also, for the VMM, a sharing system in which the computer resource is shared by a plurality of guests. The sharing system is capable of flexibly allocating the computer resource by utilizing an idle time of the computer resource, etc., and has a merit of improving a convenience.
Since both of the reliability and the convenience are important, it is expected to establish a method of balancing the reliability with the convenience by operating a VMM (a host VMM) of the occupying system and a VMM (a guest VMM) of the sharing system together between the server and the OS. This style may be called a “two-level virtual machine system” (or a multi-layer virtual machine system). However, the x86 processor corresponds only to a one-level virtual machine system (a system in which the host VMM exists but the guest VMM does not exist). Hereinafter, a function implemented in the x86 processor is summarized.
The x86 processor has a function of starting an operation of a guest and an assist function of calling a VMM by suspending the operation of the guest when a specific event occurs upon monitoring the operation of the guest. The assist function is called VT (Virtualization Technology) in a processor of Intel Corporation, whereas is called SVM (Secure Virtual Machine) in a processor of AMD, Inc., for example. Moreover, starting the operation of the guest is called “VMENTRY”, and suspending the operation of the guest is called “VMEXIT”.
In the assist function, a state of the processor during the operation of the guest is saved or restored in the memory at a time of suspending or restarting the operation of the guest. When the guest performs an operation (power-off, for example) influencing another guest, the VMM uses the assist function so as to perform emulation (an alternative process) of stopping execution of the guest, etc., instead of turning off power of the server. Upon the emulation, the VMM changes a state of the guest in the memory.
A condition to call the VMM is different depending on a policy of the VMM. For example, in the sharing system, another guest may be influenced when the guest operates the I/O, and therefore, it is required to restrict access of the guest. However, in the occupying system, the guest may operate the I/O. Therefore, according to the x86 processor, it becomes possible to finely set a VMM calling condition corresponding to a difference in the policy of the VMM. Moreover, it becomes possible to designate a region used for saving and restoring the state of the guest. The VMM calling condition and the region used for saving and restoring the state of the guest are included in a data structure called VMCS (Virtual Machine Control Structure) in the processor of Intel Corporation, and are referred from a VMCS pointer within the processor. Similarly, they are included in a data structure called VMCB (Virtual Machine Control Block) in the processor of AMD, Inc., and are referred from a VMCB pointer within the processor.
Since the x86 processor corresponds to only the one-level virtual machine system, the host VMM operates the guest VMM by emulating the assist function in order to construct the two-level virtual machine system (Patent Application Laid-Open Publication No. 2009-3749). The host VMM creates or manages two types of VMCS (the VMCB, if the processor of AMD, Inc.: hereinafter, the same applies) corresponding to an operation subject (the guest VMM or the guest OS). Moreover, the host VMM also refers or updates the VMCS created by the guest VMM as required. Hereinafter, VMCS which is created or managed by the host VMM and corresponds to the guest VMM is mentioned as “host VMCS for guest VMM”, VMCS which is created or managed by the host VMM and corresponds to the guest OS is mentioned as “host VMCS for guest OS”, and VMCS which is created by the guest VMM is mentioned as “guest VMCS”.